typedef int ElemType;

void Reserve(ElemType R[], int left, int right) {
    int mid = (left + right) / 2;
    int i;
    for (i = 0; i <= mid - left; i++) {
        ElemType t = R[left + i];
        R[left + i] = R[right - i];
        R[right - i] = R[left + i];
    }
}

void Converse(ElemType R[], int n, int p) {
    Reserve(R, 0, p - 1);
    Reserve(R, p, n - 1);
    Reserve(R, 0, n - 1);
}